home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 25 / AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso / PublicDomain / Spiele / SSheep / Developers / SSheep.AMOS / SSheep.amosSourceCode < prev    next >
AMOS Source Code  |  1994-07-29  |  11KB  |  444 lines

  1. Screen Open 0,640,20,2,Hires
  2. Palette $0,$FFF
  3. Curs Off : Flash Off : Hide 
  4. Print "Shivering Sheep V1.1 by Lee Hesselden of Satanic Dreams"
  5. Wait 50
  6. '
  7. ' +-----------------+    
  8. ' | SHIVERING SHEEP |  
  9. ' +-----------------+  
  10. '
  11. ' IFF PICTURES:
  12. '
  13. ' 10 - Playing Area  
  14. ' 11 - Level Complete
  15. ' 12 - Score Panel 
  16. ' 13 - Title Screen
  17. ' 15 - Game Over 
  18. '
  19. BEG:
  20. MOUSE=0 : EXL=2500 : PISS=1
  21. Track Play 3
  22. '
  23. Screen Open 2,640,256,16,Hires : Cls 0
  24. Screen Open 4,320,240,32,Lowres : Cls 0
  25. If FIRST=0 Then Goto STORY
  26. Goto SETUP
  27. '
  28. STORY:
  29. Screen Open 1,640,256,16,Hires : Cls 1 : Paper 0 : Pen 1
  30. Screen Display 1,,130,,
  31. Unpack 12,0,0
  32. Get Palette 0,1
  33. Palette $0,$EEE,0,$4D,0,$F40
  34. '
  35. Rainbow Del : Hide 
  36. Restore TEKST : Read N : Dim TE$(N)
  37. For X=1 To N : Read TE$(X) : Next 
  38. '
  39. Screen Open 0,640,N*8+256,2,Hires : Curs Off : Cls 0
  40. Colour 0,$0 : Colour 1,$0
  41. SPEED=3
  42. '
  43. For I=1 To N : Print TE$(I) : Next 
  44. Set Rainbow 0,1,3000,"(16,1,16)","(16,1,16)","(16,1,16)"
  45. EFX
  46. Rainbow 0,,0,256
  47. Screen Display 0,128,300,320,255
  48. '
  49.    Screen Display 0,,280,,
  50.    Screen Offset 0,0,0
  51.    For Y=280 To 40 Step -1
  52.       If SPEED>0 Then Wait SPEED
  53.       Wait Vbl 
  54.       If Mouse Key=1 Then Rainbow Del : Goto SETUP
  55.       Screen Display 0,128,Y,320,258
  56.    Next 
  57.    For Y=0 To N*8
  58.       If SPEED>0 Then Wait SPEED
  59.       Screen Offset 0,0,Y
  60.       Wait Vbl 
  61.       If Mouse Key=1 Then Rainbow Del : Goto SETUP
  62.    Next 
  63. Rainbow Del 
  64. '
  65. SETUP:
  66. FIRST=1
  67. Unpack 12 To 1 : Screen Hide 1
  68. Unpack 10 To 0 : Screen Hide 0
  69. H=90 : LEVEL=1
  70. '
  71. Hide On : Curs Off : Paper 0 : CHEAT=0
  72. Unpack 13 To 4
  73.  
  74. Screen Display 4,,50,,
  75. Screen Display 1,,Screen Height-45,,
  76. 0 A$=Inkey$ : If A$="" Then Goto 0
  77. If A$="2" Then MOUSE=1 : Goto 1
  78. If A$="j" Then Gosub CHEAT
  79. If A$<>"1" Then Goto 0
  80. '
  81. 1 Fade 5 : Wait 75 : Screen To Front 2 : Screen 0
  82. Limit Mouse 420,80 To 430,220 : Double Buffer 
  83. Bob 1,295,H,6
  84. '
  85. Screen 1
  86. Paper 0 : Pen 1
  87. '
  88. Locate 28,27 : LVS=1 : Print LVS : Rem * Lives  
  89. Locate 43,27 : SCO=0 : Print SCO : Rem * Score
  90. '
  91. Locate 28,29 : PISS=1 : Print LEVEL : Rem * Level
  92. Locate 43,29 : SHP=0 : Print SHP : Rem * Sheep
  93. NEED=0 : HALF=0 : GOLD=0
  94. '
  95. YS=120 : XS=-150
  96. '
  97. INIT_AMMO[50]
  98. AMO=50
  99. DISPLAY_AMMO[AMO]
  100. Screen Close 4
  101. Screen Show 1
  102. Screen Show 0
  103. '
  104. Do 
  105.    If Y=1 Then XS=40
  106.    If X=1 Then YS=50
  107.    Dec YS : If YS=50 Then X=1
  108.    Inc XS : If XS=40 Then Y=1
  109.    Screen Display 1,,YS,,
  110.    Screen Display 0,,XS,,
  111.    Screen To Back 2
  112.    If Y=1 and X=1 Then Y=0 : X=0 : Goto 3
  113.    Wait Vbl 
  114.    If Mouse Key=1 Then Y=1 : X=1
  115. Loop 
  116. '
  117. 3 Screen Close 2
  118. '
  119. Track Stop 
  120. Screen Open 7,640,10,16,Hires
  121. Screen Display 7,,218,,
  122. Curs Off : Flash Off : Cls 0 : Paper 0 : Pen 2
  123. Centre "Shivering Sheep!"
  124. '
  125. Gosub 20 : Goto 25
  126. '  
  127. Procedure INIT_AMMO[N]
  128.    Global XAMO,YAMO,SXAMO,SYAMO,AMAX,AMO
  129.    '
  130.    XAMO=6 : YAMO=187 : SXAMO=561 : SYAMO=16
  131.    '
  132.    Cls 5,XAMO,YAMO To XAMO+SXAMO,YAMO+SYAMO
  133.    AMAX=N : AMO=AMAX
  134. End Proc
  135. Procedure DISPLAY_AMMO[A]
  136.    Global XAMO,YAMO,SXAMO,SYAMO,AMAX
  137.    If A<AMAX
  138.       C=XAMO+(SXAMO*A)/AMAX
  139.       Cls 0,C,YAMO To XAMO+SXAMO,YAMO+SYAMO
  140.    End If 
  141. End Proc
  142. '
  143. 20 S=0 : BS=Rnd(10)+1
  144.    If BS<5 Then S=2
  145.    If BS=>5 Then S=3
  146.    If BS>10 Then S=4
  147.    If S=0 Then S=3
  148. Screen 0 : POS=Int(Rnd(135)+30) : B=0
  149. Bob 0,B,POS,S : Return 
  150. '
  151. 25 Rem ***
  152.    Global TIM,AMO,SHP,CHEAT,JO,X,Y,H,B,S
  153.    Repeat 
  154.    Inc B
  155.    If LEVEL<2 Then Gosub LEVEL5
  156.    If LEVEL>2 Then WLEVEL
  157.    Screen 0 : Bob 0,B,Y,S : Screen 1
  158.    Wait Vbl 
  159.    If B>260 Then Bell : Goto 50
  160.    A$=Inkey$
  161.    If A$="b" and CHEAT=1 Then AMO=50 : INIT_AMMO[50] : Wait 2
  162.    If A$="s" and CHEAT=1 Then Gosub HELLO : Goto 49
  163.    If A$=Chr$(27) Then End 
  164. '
  165. If Mouse Key=1 and AMO>0 and D=0 Then Dec AMO : Gosub 60
  166. ' Read the joystick  
  167. 27 J=Joy(1)
  168. ' UP 
  169.       If J and 1 : Dec H : End If 
  170. ' DOWN 
  171.       If J and 2 : Inc H : End If 
  172. ' FIRE 
  173.       If J and 16 and MOUSE<>1 and AMO>0 and D=0 : Dec AMO : Gosub 60 : End If 
  174. '
  175. If MOUSE=1 Then H=Y Screen(Y Mouse)
  176. If MOUSE=1 Then Bob 1,295,Y Screen(Y Mouse),6
  177. If MOUSE<>1 Then Bob 1,295,H,6
  178. If MOUSE<>1 and H>175 Then H=175
  179. If MOUSE<>1 and H<30 Then H=30
  180. '
  181. If R=1 Then Return 
  182. Until AMO=0 or SHP>24
  183. If PISS>19 Then Goto 65
  184. 49 If SHP>24 Then Screen 1 : Locate 28,29 : PISS=PISS+1 : SCO=SCO+1000 : Print PISS : SHP=0 : Gosub LEVCOM : Screen 0 : Goto 25
  185.    If AMO=0 Then Goto AMMO
  186. 50 Goto 250
  187. ' Screen To Front 1 : Unpack 15 To 1 : Gosub 300 : Wait Key : Goto BEG 
  188. '
  189. 60 Shoot : Wait 2 : DISPLAY_AMMO[AMO] : Screen 0
  190. Bob 1,284,H,7
  191. Wait 5
  192. Bob 1,290,H,6
  193. ' *****************************************************
  194. D=270 : P=H-18
  195. 61 Screen 0 : D=D-10 : Inc B
  196. Bob 9,D,P,8
  197. C=Bob Col(0)
  198. If C=-1 and S=2 Then Paste Bob B-30,Y-40,11 : Goto SCORE
  199. If C=-1 and S=3 Then Paste Bob B-25,Y-25,12 : Goto SCORE
  200. If C=-1 and S=4 Then Paste Bob B-25,Y-25,12 : Goto SCORE
  201.      If Y=POS-1 Then Y=POS+1 : Else Y=POS-1
  202.      Screen 0 : Bob 0,B,Y,S : Screen 1
  203.      If B>260 Then Goto 50
  204. R=1 : Gosub 27 : R=0
  205. If D=0 Then Return 
  206. If D<>0 Then Goto 61
  207. '
  208. Gosub 20
  209. Return 
  210. '
  211. SCORE:
  212. Bob Off 0
  213. Bob Off 9
  214. R=1 : Gosub 27 : R=0
  215. If S=2 Then SCO=SCO+50
  216. If S=3 Then SCO=SCO+25
  217. If S=4 Then SCO=SCO+500 : Inc GOLD
  218. L=S
  219. If SCO>999999 Then SCO=999999
  220. D=0 : Gosub 20
  221. SHP=SHP+1
  222. If SHP=2 Then Gosub 400
  223. If SHP=4 Then Gosub 410
  224. If SHP=6 Then Gosub 400
  225. If SHP=8 Then Gosub 410
  226. If SHP=10 Then Gosub 400
  227. If SHP=12 Then Gosub 410
  228. If SHP=14 Then Gosub 400
  229. If SHP=16 Then Gosub 410
  230. If SHP=20 Then Gosub 400
  231. If SHP=24 Then Gosub 410
  232. '
  233. Screen 1
  234. '
  235. If GOLD>4 Then GOLD=0 : Inc LVS : Locate 28,27 : Print LVS
  236. '
  237. 62 Screen 1 : Locate 43,29 : Print "        " : Locate 43,27 : Print SCO : Locate 43,29 : Print SHP
  238. Screen 0 : Return 
  239. '
  240. LEVCOM:
  241. Unpack 11 To 3 : YS=-5
  242. Do 
  243.    Inc YS : If YS>38 Then Goto LEVELGO
  244.    Screen Display 3,,YS,,
  245.    Wait Vbl 
  246. Loop 
  247. '
  248. LEVELGO:
  249. YS=38 : Wait 25
  250. Do 
  251.    Dec YS : If YS=-5 Then Goto 65
  252.    Screen Display 3,,YS,,
  253.    Wait Vbl 
  254. Loop 
  255. '
  256. 65 If PISS>19 Then FINISH=1 : Goto 410 : Else Goto 62
  257. '
  258. LEVEL5:
  259.  If Y=POS-1 Then Y=POS+1 : Else Y=POS-1
  260. Return 
  261. '
  262. Procedure WLEVEL
  263.  If Y=POS-1 Then Y=POS+1 : Else Y=POS-1
  264. End Proc
  265. '
  266. HELLO:
  267. SHP=SHP+1
  268. Locate 43,29 : Print SHP
  269. Wait 5
  270. If SHP>24 Then Bob Off 9 : Bob Off 0 : Return 
  271. Goto HELLO
  272. '
  273. CHEAT:
  274. 200 A$=Inkey$ : If A$="" Then Goto 200
  275. If A$="e" Then Goto 205
  276. Goto 230
  277. '
  278. 205 A$=Inkey$ : If A$="" Then Goto 205
  279. If A$="n" Then Goto 210
  280. Goto 230
  281. '
  282. 210 A$=Inkey$ : If A$="" Then Goto 210
  283. If A$="n" Then Goto 215
  284. Goto 230
  285. '
  286. 215 A$=Inkey$ : If A$="" Then Goto 215
  287. If A$="y" Then Goto 220
  288. Goto 230
  289. '
  290. 220 If CHEAT=0 Then CHEAT=1 : Goto 222
  291. If CHEAT=1 Then CHEAT=0
  292. SCN=21
  293. Do 
  294.    Inc SCN : If SCN=50 Then Goto 225
  295.    Screen Display 4,,SCN,,
  296.    Wait Vbl 
  297. Loop 
  298. '
  299. 222 SCN=50
  300. Do 
  301.    Dec SCN : If SCN=21 Then Goto 225
  302.    Screen Display 4,,SCN,,
  303.    Wait Vbl 
  304. Loop 
  305. '
  306. 225 Goto 0
  307. '
  308. 230 T=0
  309. If A$="2" Then MOUSE=1 : Goto 1
  310. If A$<>"1" Then Goto 0
  311. '
  312. 250 If LVS=1 Then Screen To Front 0 : Unpack 15 To 0 : Gosub 300 : Goto WAII
  313. LVS=LVS-1 : Bob Off 9 : Bob Off 0 : Screen 1 : Locate 28,27 : Print LVS : Screen 0 : Gosub 20 : Goto 25
  314. '
  315. WAII:
  316. If Mouse Key=1 Then Goto BEG
  317. Goto WAII
  318. '
  319. 300 Track Play 3
  320. Locate 1,8 : Print "           "
  321. Locate 1,8 : Print SCO
  322. Locate 1,9
  323. If PISS<5 Then Print " Very Poor "
  324. If PISS>4 and PISS<10 Then Print " Poor      "
  325. If PISS>9 and PISS<15 Then Print " Average   "
  326. If PISS>14 and PISS<20 Then Print " Good      "
  327. If PISS=20 Then Print " Excellent "
  328. '
  329. Return 
  330. '
  331. 400 Rem ** Move Text Screen ( OFF )
  332. Screen To Front 0 : MV=218
  333. Do 
  334.    MV=MV-1
  335.    Screen Display 7,,MV,,
  336.    Wait Vbl 
  337.    If MV=208 Then Return 
  338. Loop 
  339. '
  340. 410 Rem ** Move Text Screen ( ON ) 
  341. Screen To Front 0 : MV=208
  342. Screen 7 : Cls 0
  343.  If SHP=4 Then Centre "Extra Life Every 2500 Points!"
  344.  If SHP=8 Then Centre "50 Points Every Big Sheep Killed!"
  345.  If SHP=12 Then Centre "25 Points Every Small Sheep Killed!"
  346.  If SHP=16 Then Centre "500 Points Every Gold Sheep Killed"
  347.  If SHP=24 Then Centre "Get More Ammo at Gobeye's Gun Store!"
  348.  If FINISH=1 Then Centre "Congratulations! You've Done it!"
  349. Do 
  350.    MV=MV+1
  351.    Screen Display 7,,MV,,
  352.    Wait Vbl 
  353.    If MV=218 Then If FINISH=1 Then Wait 100 : Goto 250 : Else Return 
  354. Loop 
  355. '
  356. AMMO:
  357. Screen Open 2,640,175,16,Hires
  358. Screen Display 2,,40,,
  359. AA=0 : AB=0 : AC=0 : AD=0 : AE=0
  360. Cls 2 : Curs Off : Flash Off : Paper 2 : Pen 0 : Cls 2
  361. Print : Print " GOBEYE'S GUN STORE"
  362. Print : Print " You have";SCO;" points."
  363. Print " I will convert your points into cash!"
  364. Print : Print "